#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "searchlineedit.h"

#include <QHBoxLayout>
#include <QPushButton>
#include <QMessageBox>
#include <QDebug>

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    mLineEdit = new SearchLineEdit;
    mPushButtonOk = new QPushButton("OK");

    QVBoxLayout *vboxlayout = new QVBoxLayout;
    vboxlayout->addWidget(mLineEdit);
    vboxlayout->addWidget(mPushButtonOk);

    ui->centralwidget->setLayout(vboxlayout);
    mLineEdit->show();

    connect(mPushButtonOk,SIGNAL(clicked()),this,SLOT(onBtnOkClicked()));
}

MainWindow::~MainWindow()
{
    delete ui;
}

void MainWindow::onBtnOkClicked()
{
    qDebug() << "button clicked " << "text is " << mLineEdit->text();
}
